<%-- 
    Document   : detailProductPage
    Created on : Jan 24, 2013, 9:50:36 PM
    Author     : minhtrungn
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
    <head>
    </head>
    <body onload="countCart();">
        <%@include file="/WEB-INF/headerMainPage.jsp" %>
        <div class="background-main" align="center">
            <c:set var="productDetail" value="${requestScope.productDetail}"/>
            <c:set var="commentList" value="${requestScope.listComment}"/>
            <c:if test="${not empty productDetail}">
                <div id="viewDetail-wraper">
                    <c:forEach var="detail" items="${productDetail}">
                        <div id="image-wrapper">
                            <div id="image">
                                <img src="Pictures/xmlImg/${detail.productImg}" width="100%" height="100%"/>
                            </div>
                            <div id="${detail.productID}_productName" style="display: none;">${detail.productName}</div>
                            <div id="${detail.productID}_productPrice" style="display: none;">${detail.price}</div>
                            <div class="button-action">
                                <input type="hidden" id="${detail.productID}_productId" name="id" value="${detail.productID}"/>
                                <button type="submit" name="btnAction" value="AddCart" onclick="addCart1(${detail.productID});">Thêm giỏ hàng</button>
                            </div>
                        </div>

                        <div id="inforProduct-wraper">
                            <div id="viewNameProduct" align="left">${detail.productName}</div>
                            <div id="viewPriceProduct" align="left">${detail.price}</div>
                            <div id="viewDescriptionProduct" >
                                <textarea readonly>${detail.description}</textarea>
                            </div>
                        </div>
                    </c:forEach>
                    <div id="comment-warper">
                        <c:if test="${not empty commentList}">
                            <div id="viewComment">
                                <textarea name="txtViewComment" readonly>
                                    ${commentList.content}
                                </textarea>
                            </div>
                        </c:if>
                        <c:if test="${empty commentlist}">
                            <div id="viewComment">
                                <textarea id="commentContent-show" name="txtViewComment" readonly>
                                    
                                </textarea>
                            </div>
                        </c:if>
                        <div id="writeComment">
                            <textarea id="commentContent" name="txtWriteComment"></textarea>
                        </div>
                        <button type="button" name="btnAction" value="sendComment" onclick="comment(${detail.productID})">Gửi</button>
                    </div>
                </div>
            </c:if>

        </div>
    </body>
</html>
